module sidearm.error;

import std.exception;

class ParseException : Exception
{
	this(string msg)
	{
		super(msg);
	}


}

class LexException : ParseException
{
	this() { super("Lexer Exception!");}
}

class InvalidUTFSequence : LexException
{

}

class InternalException : ParseException
{
	this() { super(">>Internal Error<<");}

}

class UnexpectedTokenException : ParseException
{
	this() { super(">>Unexpected Token<<");}

}

class UnexpectedEOFException : ParseException
{
	this() { super(">>Unexpected EOF Found<<");}

}

class OverflowException : ParseException
{
	this() { super(">>Overflow<<");}

}

class VarOverflowException : OverflowException
{

}

class StringOverflowException : OverflowException
{

}

class IndexOverflowException : OverflowException
{

}

class StackOverflowException : OverflowException
{

}


class VarNotDefinedException : ParseException
{
	this() { super(">>Variable Not Defined<<");}

}

class VarDefinedException : ParseException
{
	this() { super(">> Variable Already Defined<<");}

}

class GenericSyntaxException : ParseException
{

	this() { super("Lexer Exception!");}

}

class MemoryException : ParseException
{
	this() { super(">>Memory Problem<<");}

}

class LabelNotDefinedException : ParseException
{
	this() { super(">>Label Not Defined<<");}

}

class LabelDefinedException : ParseException
{
	this() { super(">>Label Already Defined<<");}

}

class DivByZeroException : ParseException
{
	this() { super(">>Division by Zero<<");}

}

class GenericFileException : Exception
{
	this(string msg) { super("File Exception: "~msg); }
}

class ReadUnableFileException : GenericFileException
{
	this() { super("Cannot read file."); }
}

class WriteUnableFileException : GenericFileException
{
	this() { super("Cannot write to file."); }
}

class OutOfBoundsException : ParseException
{
	this() { super(">>Out of Bounds<<");}


}

class UnknownOpcodeException : ParseException
{
	this() { super(">>Unknown OPCODE<<");}

}

class InvalidOpcodeException : ParseException
{
	this() { super(">>Invalid OPCODE<<");}

}

class BytecodeException : Exception
{
	this() { super(">>Bytecode Error<<"); }
}

class IllegalArgumentException : Exception
{
	this(string msg) { super("Illegal Argument: "~msg); }
}



